<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/9/19
  Time: 9:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <script type="text/javascript" src="<c:url value='/js/jquery-1.8.2.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/js/calendarTime.js'/>"></script>
</head>
<script>
    $().ready(function () {
        var msg = '${msg}';
        if(msg!=null&&msg!=""){
            alert(msg);
        }
    })
</script>
<body>
    <center>
        <form action="<c:url value='/airServlet'/>" method="post">
            <input type="hidden" name="method" value="update"/>
            <input type="hidden" name="id" value="${ab.id}"/>

        <table>
            <tr align="center">
                <td colspan="100">
                    <h1>空气质量信息维护页面</h1>
                </td>
            </tr>
            <tr>
               <td align="right">监测区域：</td>
                <td>
                    <select name="districtid">
                        <option value="-1">不限</option>
                        <c:forEach var="d" items="${list}">
                            <option value="${d.id}" ${ab.districtid==d.id?'selected':''}>${d.name}</option>
                        </c:forEach>
                    </select>
                </td>
            </tr>
            <tr>
                <td align="right">监测日期：</td>
                <td>
                    <input type="text" name="monitortime" onclick="setDay(this)" readonly value="${ab.monitortime}"/>
                </td>
            </tr>
            <tr>
                <td align="right">PM10值：</td>
                <td>
                    <input type="text" name="pm10" value="${ab.pm10}"/>
                </td>
            </tr>
            <tr>
                <td align="right">PM25值：</td>
                <td>
                    <input type="text" name="pm25" value="${ab.pm25}"/>
                </td>
            </tr>
            <tr>
                <td align="right">监测站：</td>
                <td>
                    <input type="text" name="monitoringstation" value="${ab.monitoringstation}"/>
                </td>
            </tr>
            <tr>
                <td align="right">最后修改时间：</td>
                <td>
                    ${ab.lastmodifytime}
                </td>
            </tr>
            <tr align="center">
                <td colspan="2">
                    <input type="submit" value="更新">
                    <%--
                        这个删除，因为题目要求，删除成功了，直接删除返回列表，但是要是失败了，需要返回更新页面，而且数据的在
                        1、使用ajax删除，要是删除成功了，直接调到list页面，失败了，当前页面不刷新，数据就在
                    --%>
                    <a href="<c:url value='/airServlet?method=delete&id=${ab.id}'/>"><input type="button" value="删除"/></a>
                    <a href="<c:url value='/airServlet?method=list'/>"><input type="button" value="返回"/></a>
                </td>
            </tr>
        </table>
        </form>
    </center>
</body>
</html>
